{% extends "./inc_base.html" %}
{% block content %}
{%set cate = category.id|get_cate()%}
{%if category.pid !=0%}
{%column data="column",pid=category.pid%}
{%else%}
{%column data="column",cid=category.id%}
{%endif%}
<!--
PAGE HEADER

CLASSES:
.page-header-xs	= 20px margins
.page-header-md	= 50px margins
.page-header-lg	= 80px margins
.page-header-xlg= 130px margins
.dark			= dark page header

.shadow-before-1 	= shadow 1 header top
.shadow-after-1 	= shadow 1 header bottom
.shadow-before-2 	= shadow 2 header top
.shadow-after-2 	= shadow 2 header bottom
.shadow-before-3 	= shadow 3 header top
.shadow-after-3 	= shadow 3 header bottom
-->
<section class="page-header page-header-xs " >
    <div class="container">
        {%if column|length>0%}
        <h1>{{category.title}}</h1>
        {%endif%}
        <!-- breadcrumbs -->
        <ol class="breadcrumb {%if column|length==0%} breadcrumb-inverse {%endif%}">
            <li><a href="/">首页</a></li>
            {%for val in breadcrumb %}
            {% if val.id == category.id %}
            <li class="active">{{val.title}}</li>
            {% else %}
            <li><a href="{{val.url}}">{{val.title}}</a></li>

            {% endif %}
            {% endfor %}
        </ol><!-- /breadcrumbs -->
        <!-- page tabs -->

        {%if column|length>0%}
        <ul class="page-header-tabs list-inline">

            <li {%if breadcrumb[0].id == category.id %}class="active"{%endif%}><a href="{{breadcrumb[0].url}}">全部</a></li>
            {%for val in column%}
            <li  {%if val.id == category.id %}class="active"{%endif%}><a href="{{val.url}}">{{val.name}}</a></li>
            {%endfor%}
        </ul>
        {%endif%}
        <!-- /page tabs -->
    </div>
</section>
<!-- /PAGE HEADER -->
<!-- -->
<section >
    <div class="container">

        <!--分类信息-->
        {% include "./inc_sort.html" %}
        <!--/分类信息-->
        <div class="row">

            <!-- LEFT -->
            <div class="col-md-12 col-sm-12">
                <div class="panel panel-default tabs">
                    <div class="panel-heading clearfix">

                            <ul class="nav nav-tabs pull-left">

                                <li class="filter {%if group_id==0%}active{%endif%}"><a href="{{cate.url}}">全部</a></li>
                                {% groups data="groups",cid=category.id%}
                                {%for v in groups%}
                                <li class="filter {%if group_id==v.id%}active{%endif%}"><a href="{{cate.url}}-{{order}}-{{v.id}}{%if sort%}-{{sortid}}{%endif%}{%if sorturl %}-{%endif%}{{sorturl}}">{{v.name}}</a></li>
                                {%endfor%}
                            </ul>
                        <div class="text-left pull-right" style="margin-bottom: -5px">
                            <div class="btn-group btn-group-xs">
                                <a class="btn btn-default height-auto {%if order<2%}active{%endif%}" href="{{cate.url}}-{%if order<2%}{{1-order}}{%else%}0{%endif%}{%if group_id or sort%}-{{group_id}}{%endif%}{%if sort%}-{{sortid}}{%endif%}{%if sorturl %}-{%endif%}{{sorturl}}" >按时间 <span class="glyphicon {%if order ==0%}glyphicon-arrow-down{%elif order==1%}glyphicon-arrow-up{%else%}glyphicon-arrow-down{%endif%}"></span> </a>
                                <a class="btn btn-default height-auto {%if order>=2%}active{%endif%}" href="{{cate.url}}-{%if order>=2%}{%if order ==2%}3{%else%}2{%endif%}{%else%}2{%endif%}{%if group_id or sort%}-{{group_id}}{%endif%}{%if sort%}-{{sortid}}{%endif%}{%if sorturl %}-{%endif%}{{sorturl}}" style="height: auto">按人气<span class="glyphicon  {%if order ==2%}glyphicon-arrow-down{%elif order==3%}glyphicon-arrow-up{%else%}glyphicon-arrow-down{%endif%}"></span></a>
                            </div>
                            <!--投稿按钮-->
                            {%if category.id|priv(controller.user.roleid,'add',0,false)%}

                            <div class="btn-group btn-group-xs ">
                                <a {%if model|length> 1 %} data-toggle="dropdown" {% endif %} class="btn btn-primary btn-sm document_add
                                    dropdown-toggle {% if allow == 0 %}disabled{% endif %}" {%if model|length
                                    == 1 %} href="/center/publish/add/model_id/{{modellist[0].id}}/pid/0/cate_id/{{cate.id}}/group_id/{{group_id}}/sortid/{{sortid}}"{%endif%}
                                    ><span class="fa fa-pencil-square-o"></span> 投稿 {%if model|length > 1 %}<span class="caret"></span>{% endif %}</a>
                                {%if model|length > 1 %}
                                <ul class="dropdown-menu">

                                    {% for val in modellist%}
                                    <li> <a href="/center/publish/add/model_id/{{val.id}}/pid/0/cate_id/{{cate.id}}/group_id/{{group_id}}/sortid/{{sortid}}"
                                            class="text-info">添加{{val.title}}</a></li>
                                    {% endfor %}

                                    <!--<li class="divider"></li>-->
                                    <!--<li><a href="#">添加内容</a></li>-->
                                </ul>
                                {% endif %}
                            </div>

                            {%endif%}
                            <!--//投稿按钮-->


                        </div>
                    </div>
                    <div class="panel-body">

                        <div class="divider divider-circle divider-center margin-top-0"><!-- divider -->
                            <a href="#"><i class="fa fa-rss"></i></a>
                        </div>
                        <ul class="shop-item-list row list-inline nomargin">
                            {% for val in list %}
                            <div class="col-md-4">

                                <div class="box-icon box-icon-center box-icon-round box-icon-transparent box-icon-large box-icon-content">
                                    <a class="box-icon-title" href="{{val.name|get_url(val.id)}}" target="_blank">
                                        {%if val.cover_id%}<i><img class="thumbnail rounded" src="{{val.cover_id|get_pic('m=0')}}" style="width: 65px;height: 65px; margin-top: -1px;margin-left: -2px"></i>{%else%}<i class="et-document" style="font-size: 32px"></i>{%endif%}
                                        <h2>{{val.title}}</h2>
                                    </a>
                                </div>

                            </div>
                            {%endfor%}
                        </ul>
                    </div>
                    <div class="panel-footer text-left">
                        {{pagination | safe}}
                    </div>
                </div>



            </div>

            <!-- RIGHT -->

        </div>

    </div>
</section>
<!-- / -->
{% endblock %}
{% block style %}
<link href="/static/assets/css/layout-shop.css" rel="stylesheet" type="text/css" />
{% endblock %}